package javas.net;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class TestUdpSend {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		   DatagramSocket ds = new DatagramSocket();
		   String str = "hello , world!";
		   byte[] data = str.getBytes();
		   DatagramPacket dp = new DatagramPacket(data, data.length, InetAddress.getByName("127.0.0.1"),10000);
		   ds.send(dp);
		   ds.close(); //�ر�����
	}

}
